/*-------------------------------------------------*/
#ifndef _P2PLAYER_H
#define _P2PLAYER_H

#pragma once

#ifndef P2P_PREFIX
#error Could not find P2P Prefix !!
#endif

#if (P2P_PREFIX == 1)

#include "PPCS_API.h"

#define st_P2P_NetInfo                          st_PPCS_NetInfo
#define st_P2P_Session                          st_PPCS_Session


#define ERROR_P2P_SUCCESSFUL                    ERROR_PPCS_SUCCESSFUL
#define ERROR_P2P_NOT_INITIALIZED               ERROR_PPCS_NOT_INITIALIZED
#define ERROR_P2P_ALREADY_INITIALIZED           ERROR_PPCS_ALREADY_INITIALIZED
#define ERROR_P2P_TIME_OUT                      ERROR_PPCS_TIME_OUT
#define ERROR_P2P_INVALID_ID                    ERROR_PPCS_INVALID_ID
#define ERROR_P2P_INVALID_PARAMETER             ERROR_PPCS_INVALID_PARAMETER
#define ERROR_P2P_DEVICE_NOT_ONLINE             ERROR_PPCS_DEVICE_NOT_ONLINE
#define ERROR_P2P_FAIL_TO_RESOLVE_NAME          ERROR_PPCS_FAIL_TO_RESOLVE_NAME
#define ERROR_P2P_INVALID_PREFIX                ERROR_PPCS_INVALID_PREFIX
#define ERROR_P2P_ID_OUT_OF_DATE                ERROR_PPCS_ID_OUT_OF_DATE
#define ERROR_P2P_NO_RELAY_SERVER_AVAILABLE     ERROR_PPCS_NO_RELAY_SERVER_AVAILABLE
#define ERROR_P2P_INVALID_SESSION_HANDLE        ERROR_PPCS_INVALID_SESSION_HANDLE
#define ERROR_P2P_SESSION_CLOSED_REMOTE         ERROR_PPCS_SESSION_CLOSED_REMOTE
#define ERROR_P2P_SESSION_CLOSED_TIMEOUT        ERROR_PPCS_SESSION_CLOSED_TIMEOUT
#define ERROR_P2P_SESSION_CLOSED_CALLED         ERROR_PPCS_SESSION_CLOSED_CALLED
#define ERROR_P2P_REMOTE_SITE_BUFFER_FULL       ERROR_PPCS_REMOTE_SITE_BUFFER_FULL
#define ERROR_P2P_USER_LISTEN_BREAK             ERROR_PPCS_USER_LISTEN_BREAK
#define ERROR_P2P_MAX_SESSION                   ERROR_PPCS_MAX_SESSION
#define ERROR_P2P_UDP_PORT_BIND_FAILED          ERROR_PPCS_UDP_PORT_BIND_FAILED
#define ERROR_P2P_USER_CONNECT_BREAK            ERROR_PPCS_USER_CONNECT_BREAK
#define ERROR_P2P_SESSION_CLOSED_INSUFFICIENT_MEMORY \
        ERROR_PPCS_SESSION_CLOSED_INSUFFICIENT_MEMORY
#define ERROR_P2P_INVALID_APILICENSE            ERROR_PPCS_INVALID_APILICENSE
#define ERROR_P2P_FAIL_TO_CREATE_THREAD         ERROR_PPCS_FAIL_TO_CREATE_THREAD

#define P2P_GetAPIVersion() \
        PPCS_GetAPIVersion()

#define P2P_QueryDID(DeviceName, DID, DIDBufSize) \
        PPCS_QueryDID(DeviceName, DID, DIDBufSize)

#define P2P_Initialize(Parameter) \
        PPCS_Initialize(Parameter)

#define P2P_DeInitialize() \
        PPCS_DeInitialize()

#define P2P_NetworkDetect(NetInfo, UDP_Port) \
        PPCS_NetworkDetect(NetInfo, UDP_Port)

#define P2P_NetworkDetectByServer(NetInfo, UDP_Port, ServerString) \
        PPCS_NetworkDetectByServer(NetInfo, UDP_Port, ServerString)

#define P2P_Share_Bandwidth(bOnOff) \
        PPCS_Share_Bandwidth(bOnOff)

#define P2P_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense) \
        PPCS_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense)

#define P2P_Listen_Break() \
        PPCS_Listen_Break()

#define P2P_LoginStatus_Check(bLoginStatus) \
        PPCS_LoginStatus_Check(bLoginStatus)

#define P2P_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense) \
        PPCS_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense)

#define P2P_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense) \
        PPCS_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense)

#define P2P_Connect(TargetID, bEnableLanSearch, UDP_Port) \
        PPCS_Connect(TargetID, bEnableLanSearch, UDP_Port)

#define P2P_ConnectByServer(TargetID, bEnableLanSearch, UDP_Port, ServerString) \
        PPCS_ConnectByServer(TargetID, bEnableLanSearch, UDP_Port, ServerString)

#define P2P_Connect_Break() \
        PPCS_Connect_Break()

#define P2P_Check(SessionHandle, SInfo) \
        PPCS_Check(SessionHandle, SInfo)

#define P2P_Close(SessionHandle) \
        PPCS_Close(SessionHandle)

#define P2P_ForceClose(SessionHandle) \
        PPCS_ForceClose(SessionHandle)

#define P2P_Write(SessionHandle, Channel, DataBuf, DataSizeToWrite) \
        PPCS_Write(SessionHandle, Channel, DataBuf, DataSizeToWrite)

#define P2P_Read(SessionHandle, Channel, DataBuf, DataSize, TimeOut_ms) \
        PPCS_Read(SessionHandle, Channel, DataBuf, DataSize, TimeOut_ms)

#define P2P_Check_Buffer(SessionHandle, Channel, WriteSize, ReadSize) \
        PPCS_Check_Buffer(SessionHandle, Channel, WriteSize, ReadSize)

#else

#include "PPPP_API.h"

#define st_P2P_NetInfo                          st_PPPP_NetInfo
#define st_P2P_Session                          st_PPPP_Session


#define ERROR_P2P_SUCCESSFUL                    ERROR_PPPP_SUCCESSFUL
#define ERROR_P2P_NOT_INITIALIZED               ERROR_PPPP_NOT_INITIALIZED
#define ERROR_P2P_ALREADY_INITIALIZED           ERROR_PPPP_ALREADY_INITIALIZED
#define ERROR_P2P_TIME_OUT                      ERROR_PPPP_TIME_OUT
#define ERROR_P2P_INVALID_ID                    ERROR_PPPP_INVALID_ID
#define ERROR_P2P_INVALID_PARAMETER             ERROR_PPPP_INVALID_PARAMETER
#define ERROR_P2P_DEVICE_NOT_ONLINE             ERROR_PPPP_DEVICE_NOT_ONLINE
#define ERROR_P2P_FAIL_TO_RESOLVE_NAME          ERROR_PPPP_FAIL_TO_RESOLVE_NAME
#define ERROR_P2P_INVALID_PREFIX                ERROR_PPPP_INVALID_PREFIX
#define ERROR_P2P_ID_OUT_OF_DATE                ERROR_PPPP_ID_OUT_OF_DATE
#define ERROR_P2P_NO_RELAY_SERVER_AVAILABLE     ERROR_PPPP_NO_RELAY_SERVER_AVAILABLE
#define ERROR_P2P_INVALID_SESSION_HANDLE        ERROR_PPPP_INVALID_SESSION_HANDLE
#define ERROR_P2P_SESSION_CLOSED_REMOTE         ERROR_PPPP_SESSION_CLOSED_REMOTE
#define ERROR_P2P_SESSION_CLOSED_TIMEOUT        ERROR_PPPP_SESSION_CLOSED_TIMEOUT
#define ERROR_P2P_SESSION_CLOSED_CALLED         ERROR_PPPP_SESSION_CLOSED_CALLED
#define ERROR_P2P_REMOTE_SITE_BUFFER_FULL       ERROR_PPPP_REMOTE_SITE_BUFFER_FULL
#define ERROR_P2P_USER_LISTEN_BREAK             ERROR_PPPP_USER_LISTEN_BREAK
#define ERROR_P2P_MAX_SESSION                   ERROR_PPPP_MAX_SESSION
#define ERROR_P2P_UDP_PORT_BIND_FAILED          ERROR_PPPP_UDP_PORT_BIND_FAILED
#define ERROR_P2P_USER_CONNECT_BREAK            ERROR_PPPP_USER_CONNECT_BREAK
#define ERROR_P2P_SESSION_CLOSED_INSUFFICIENT_MEMORY \
        ERROR_PPPP_SESSION_CLOSED_INSUFFICIENT_MEMORY
#define ERROR_P2P_INVALID_APILICENSE            ERROR_PPPP_INVALID_APILICENSE
#define ERROR_P2P_FAIL_TO_CREATE_THREAD         ERROR_PPPP_FAIL_TO_CREATE_THREAD

#define P2P_GetAPIVersion()  \
	PPPP_GetAPIVersion()

#define P2P_QueryDID(DeviceName, DID, DIDBufSize) \
        PPPP_QueryDID(DeviceName, DID, DIDBufSize)

#define P2P_Initialize(Parameter) \
        PPPP_Initialize(Parameter)

#define P2P_DeInitialize() \
        PPPP_DeInitialize()

#define P2P_NetworkDetect(NetInfo, UDP_Port) \
        PPPP_NetworkDetect(NetInfo, UDP_Port)

#define P2P_NetworkDetectByServer(NetInfo, UDP_Port, ServerString) \
        PPPP_NetworkDetectByServer(NetInfo, UDP_Port, ServerString)

#define P2P_Share_Bandwidth(bOnOff) \
        PPPP_Share_Bandwidth(bOnOff)

#define P2P_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense) \
        PPPP_Listen(MyID, TimeOut_Sec, UDP_Port, bEnableInternet, APILicense)

#define P2P_Listen_Break() \
        PPPP_Listen_Break()

#define P2P_LoginStatus_Check(bLoginStatus) \
        PPPP_LoginStatus_Check(bLoginStatus)

#define P2P_Connect(TargetID, bEnableLanSearch, UDP_Port) \
        PPPP_Connect(TargetID, bEnableLanSearch, UDP_Port)

#define P2P_ConnectByServer(TargetID, bEnableLanSearch, UDP_Port, ServerString) \
        PPPP_ConnectByServer(TargetID, bEnableLanSearch, UDP_Port, ServerString)

#define P2P_Connect_Break() \
        PPPP_Connect_Break()

#define P2P_Check(SessionHandle, SInfo) \
        PPPP_Check(SessionHandle, SInfo)

#define P2P_Close(SessionHandle) \
        PPPP_Close(SessionHandle)

#define P2P_ForceClose(SessionHandle) \
        PPPP_ForceClose(SessionHandle)

#define P2P_Write(SessionHandle, Channel, DataBuf, DataSizeToWrite) \
        PPPP_Write(SessionHandle, Channel, DataBuf, DataSizeToWrite)

#define P2P_Read(SessionHandle, Channel, DataBuf, DataSize, TimeOut_ms) \
        PPPP_Read(SessionHandle, Channel, DataBuf, DataSize, TimeOut_ms)

#define P2P_Check_Buffer(SessionHandle, Channel, WriteSize, ReadSize) \
        PPPP_Check_Buffer(SessionHandle, Channel, WriteSize, ReadSize)

#endif

#endif /* _P2PLAYER_H */

/****************************** END OF FILE ********************************/
